﻿@{
    ViewBag.Title = "Home Page";
}
<div class="span3">
    <div class="well sidebar-nav">
        <ul class="nav nav-list">
            <li class="nav-header">Menü</li>
            <li><a href="#" onclick="return ProductUpdate();">Ürün Güncelle</a></li>
        </ul>
    </div>
    <!--/.well -->
</div>
<!--/span-->
<div class="span9">
    <div class="row-fluid">
        <div class="center" id="listProducts">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th data-bind='sort: "Title"'>Ürün</th>
                        <th data-bind='sort: "FirmProductId"'>Ürün Kodu</th>
                    </tr>                    
                </thead>
                <tbody data-bind="foreach: items">
                    <tr>
                        <td data-bind="text: Title"></td>
                        <td data-bind="text: FirmProductId"></td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="2">
                            <div data-bind="text: 'Toplam ' + $root.total() + ' kayıt'"></div>
                            <div class="pagination">
                                <ul data-bind="if: $root.pageLength() > 0 && $root.totalPage() > 1">
                                    <li data-bind="css: { disabled: $root.page() == 0 }"><a href="#" title="İlk" data-bind="    click: $root.methods.get.bind(0, { page: 0 })">&laquo;
                                    İlk</a></li>
                                    <li data-bind="css: { disabled: $root.page() == 0 }"><a href="#" title="Önceki" data-bind="    click: $root.methods.get.bind(0, { page: $root.page() > 0 ? $root.page() - 1 : 0 }) ">&laquo; Önceki</a></li>
                                    <!-- ko foreach:ko.utils.range(1, $root.pageLength()) -->
                                    <li data-bind="visible: GetPage($parent.page(), $data, $root.pageLength()) <= ($parent.totalPage() + 1), css: { active: $parent.page() == GetPage($parent.page(), $data, $root.pageLength()) - 1 }"><a href="#" data-bind="    text: GetPage($parent.page(), $data, $root.pageLength()), click: $root.methods.get.bind($data, { page: GetPage($parent.page(), $data, $root.pageLength()) - 1 })">a</a></li>
                                    <!-- /ko -->
                                    <li data-bind="css: { disabled: $root.page() >= $root.totalPage() }"><a href="#" title="Sonraki" data-bind="    click: $root.methods.get.bind(0, { page: $root.page() < $root.totalPage() ? $root.page() + 1 : $root.totalPage() })">Sonraki &raquo;</a></li>
                                    <li data-bind="css: { disabled: $root.page() >= $root.totalPage() }"><a href="#" title="Son" data-bind="    click: $root.methods.get.bind(0, { page: $root.totalPage() })">Son &raquo;</a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>

<script type="text/javascript">
    require(["/Scripts/Pages/Manage.js"], function (admin) {
        admin.prepare();
    });
</script>
